import {defineStore} from "pinia";
import {ref} from "vue";
import {customerLogin} from "@/apis/loginApi.js";

export const useUserStore=defineStore('userStore',()=>{
    const userInfo=ref({})
    const getUserInfo=async (params)=>{
        const res=await customerLogin(params)
        userInfo.value=res.data
        console.log(userInfo.value)
    }
    const clearUserInfo=()=>{
        userInfo.value={}
    }
    return{
        userInfo,
        getUserInfo,
        clearUserInfo,
    }
},{
    persist:true,
})